package leetcode_1901_2000;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class LeeCode_1941 {
    public static void main(String[] args) {

    }
    private static boolean areOccurrencesEqual(String s) {
        Map<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < s.length(); i++) {
            map.put(s.charAt(i), map.getOrDefault(s.charAt(i), 0) + 1);
        }
        Set<Integer> set = new HashSet<>();
        for (Character key : map.keySet()) {
            set.add(map.get(key));
        }
        return set.size() == 1;
    }
}
